
package botlab.command;

import botlab.Entity;
import com.jme3.bullet.control.RigidBodyControl;
import com.jme3.math.Vector3f;
import com.jme3.scene.Spatial;

/**
 *
 * @author Quentin
 */
public class CustomCommand extends BaseCommand
{

    @Override
    public void doCommand(Spatial spatial,float tpf)
    {
        if(spatial.getUserData("physic_type").equals(Entity.PhysicsType.KINEMATIC.toString()))
        {
            spatial.rotate(0, 2*tpf, 0);
        }
        else
        {
            spatial.getControl(RigidBodyControl.class).applyTorque(new Vector3f(0,2*tpf,0));
        }
    }
    
}
